<div id="comments"><!-- {{{ Notes -->
    <?php if($model->notesCount>=1): ?>
    <h3>
        <?php echo CHtml::encode(Yii::t('site','1#One note for item {recordName}|n>1#{notesCount} notes for item {recordName}',array($model->notesCount,'{notesCount}'=>$model->notesCount,'{recordName}'=>$model->recordName))); ?>
    </h3>

    <?php $this->render('/note/_notes',array(
        'model'=>$model,
        'notes'=>$model->notes,
    )); ?>
    <?php endif; ?>

    <h3><?php echo CHtml::encode(Yii::t('site','Add a new Note')); ?></h3>

    <?php if(Yii::app()->user->hasFlash('noteSubmitted')): ?>
        <div class="flash-success">
            <?php echo Yii::app()->user->getFlash('noteSubmitted'); ?>
        </div>
    <?php else: ?>

        <div class="wide form">

        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'note-form',
            'enableAjaxValidation'=>true,
        )); ?>

            <p class="note"><?php echo Yii::t('site','Fields with {marker} are required.',array('{marker}'=>'<span class="required">*</span>')); ?></p>

            <div class="row">
                <?php echo $form->labelEx($note,'content'); ?>
                <?php echo $form->textArea($note,'content',array('rows'=>6, 'cols'=>50)); ?>
                <?php echo $form->error($note,'content'); ?>
            </div>

            <div class="row buttons">
                <?php echo CHtml::submitButton(Yii::t('site','Add Note')); ?>
            </div>

        <?php $this->endWidget(); ?>

        </div><!-- form -->
    <?php endif; ?>
</div><!-- }}} End Notes -->
